﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Xyz.Web.Reservation.Models
{
    public class PassengerModel
    {
        public int PassengerId { get; set; }

        [DisplayName("First/Given Name (as in passport) : * ")]
        [Required(ErrorMessage = "First/Given Name (as in passport) is required")]
        [StringLength(20, ErrorMessage = "First/Given Name (as in passport) has a maximum length of 20 characters")]
        public string FirstName { get; set; }

        [DisplayName("Last Name (Family Name as in passport) : * ")]
        [Required(ErrorMessage = "Last Name(Family Name as in passport) is required")]
        [StringLength(20, ErrorMessage = "Last Name(Family Name as in passport) has a maximum length of 20 characters")]
        public string LastName { get; set; }

        [DisplayName("Title : ")]
        public string TitleCode { get; set; }

        [DisplayName("Date of Birth : * ")]
        [Required(ErrorMessage = "Date of Birth is required")]
        public DateTime DateOfBirth { get; set; }

        [DisplayName("Passport Number : * ")]
        [Required(ErrorMessage = "Passport Number is required")]
        [StringLength(20, ErrorMessage = "Passport Number has a maximum length of 20 characters.")]
        public string PassportNo { get; set; }

        [DisplayName("Passport Expiry Date : * ")]
        [Required(ErrorMessage = "Passport Expiry Date is required")]
        [ExpiryDate(ErrorMessage = "Passport Expiry Date must be valid in 3 months")]
        public DateTime PassportExpiryDate { get; set; }

        [DisplayName("Email Address : ")]
        [RegularExpression(@"^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$", ErrorMessage="Email Address is not valid")]
        public string EmailAddress { get; set; }

        [DisplayName("Contact Number : ")]
        [RegularExpression(@"^[0-9]+", ErrorMessage = "Contact number must be digit")]
        [StringLength(10,ErrorMessage="Contact Number has a maximum length of 10 characters")]
        public string ContactNo { get; set; } 
    }
}